/**
 * @author:Given.cao
 *
 */
  function rightClick(){
  	if(event.button != 1 ) {
    	alert("???? ????????????");
    	event.returnValue=false;
  	}
  }

function closeThisReloadOpener() {
	if(typeof(opener.document) != 'unknown' && typeof(opener.document) != 'undefined') {
		if(opener != null) {
			if(!opener.closed) {
				if(typeof(opener.document) != 'undefined' && typeof(opener.document) != 'unknown') {
				    	opener.document.location.reload();
				}
			}
	 	}
	}
	window.close();
}


function closeThisReloadOpenerParentOpener(closeFlag) {
	if(typeof(opener.document) != 'unknown' && typeof(opener.document) != 'undefined' && opener != null && !opener.closed) {
		if(typeof(opener.parent.document) != 'unknown' && typeof(opener.parent.document) != 'undefined' && opener.parent != null && !opener.parent.closed) {
		    if(typeof(opener.parent.opener.document) != 'unknown' && typeof(opener.parent.opener.document) != 'undefined' &&  opener.parent.opener != null && !opener.parent.opener.closed) {
				    opener.parent.opener.document.location.reload();
			}
		}
	}
	 if(closeFlag == "yes") {
		 window.close();
	 }
}

function closeThisReloadOpenerOpener(closeFlag) {
    
	if(typeof(opener.document) != 'unknown' && typeof(opener.document) != 'undefined' && opener != null && !opener.closed) {
		if(typeof(opener.opener.document) != 'unknown' && typeof(opener.opener.document) != 'undefined' && opener.opener != null && !opener.opener.closed) {
	
				    opener.opener.document.location.reload();
		}
	}
	 if(closeFlag == "yes") {
		 window.close();
	 }
}


/*??????????????????????*/
function closeClk() {
  opener.document.location.reload();
  window.close();           
}
/*??????????????????????????????????*/
function toNextFocus(itemname) {
  if(window.event.keyCode==13) {
    document.all[itemname].focus();
  }
}

function changefocus()
{
     key=window.event.keyCode;
     if(key==0xD)
     {
        if(event.srcElement.type!='button' && event.srcElement.type!='submit' && event.srcElement.type!='reset' && event.srcElement.type!='textarea') {
        	window.event.keyCode=9;
        }
     } else if(key==32)
     {
        if(event.srcElement.type=='') {
            window.event.keyCode=0xD;
        }
     }
}

/*checkbox????????*/
function checkboxIsChecked(inputComponent) {
  alert("111");
  if(document.all[inputComponent].checked) {
    alert("true");
    return true;
  } else {
    alert("false");
    return false;
  }
}

/*??????????????checkbox??????????
function tableSelectedCheckboxNum(tablename) {
    alert("tableSelectedCheckboxNum start");
    var temptable;  
    temptable = document.all[tablename];
    if (temptable.rows.length == "1"){
      return 0;
    }
    var i;
    var j=0;
    for(i=temptable.rows.length-1;i>=1;i--){
	  if(temptable.rows(i).cells(0).firstChild.checked) {
	    j++;
	  }
    }  
    return j;
}
*/

/*select current all checkbox*/
function select_all_none(tablename){
    var temptable;  
    temptable = document.all[tablename];
    if (temptable.rows.length == "1"){
      return;
    }
    var i;
    for(i=temptable.rows.length-1;i>=1;i--){
	temptable.rows(i).cells(0).firstChild.checked = temptable.rows(0).cells(0).firstChild.checked;
    }	
}
        
/*bar*/
function barClick(obj){
  if (document.all[obj].style.display=="none"){
    document.all[obj].style.display="";
    document.all[obj.toString()+"Img"].src="images/bar_down.jpg";
  }
  else
  {
    document.all[obj].style.display="none";
    document.all[obj.toString()+"Img"].src="images/bar_right.jpg";
  }   
}
 
   /*????delete*/
   function deleteClick(formName,hiddenName) {
     if (confirm("Are you sure to delete?")) {
       window.open("","Message","top=300,left=400,width=200,height=100,resizable=0,scrollbars=1");
       document.all[formName].target="Message";
   	   document.all[hiddenName].value="Sdelete";
   	   document.all[formName].submit();
     }
   } 
   
   /*delete*/
   function deleteClick(formName,hiddenName,confirmMessage) {
    if (confirm(confirmMessage)) {
         window.open("","Message","top=300,left=400,width=200,height=100,resizable=0");
         document.all[formName].target="Message";
   	     document.all[hiddenName].value="Sdelete";
   	     document.all[formName].submit();
   	}
   }    

   
 
  
   /*??????hidden????????open window*/
   function openWindow(openPageName,formName,hiddenName,hiddenValue,widthValue,heightValue) {
     var openWindowPara = "width="+widthValue+",height="+heightValue+",resizable=0,scrollbars=yes";
     window.open("",openPageName,openWindowPara);
     document.all[formName].target=openPageName;
     document.all[hiddenName].value="S"+hiddenValue;
     document.all[formName].submit(); 
   }
   
   /*????????hidden????????open window*/
   function openWindow2(openPageName,formName,widthValue,heightValue) {
     var openWindowPara = "width="+widthValue+",height="+heightValue+",resizable=0,scrollbars=1";
     window.open("",openPageName,openWindowPara);
     document.all[formName].target=openPageName;
     document.all[formName].submit();      
   }         
      
   /*??hidden????????open window*/
   function openWindow(openPageName,formName,hiddenName,hiddenValue,widthValue,heightValue,topValue,leftValue) {
     var openWindowPara = "width="+widthValue+",height="+heightValue+",top="+topValue+",left="+leftValue+",resizable=0,scrollbars=1";
     window.open("",openPageName,openWindowPara);
     document.all[formName].target=openPageName;
     document.all[hiddenName].value="S"+hiddenValue;
     document.all[formName].submit(); 
   }
   
   /*--self--????????????????????,??hidden????????????????open window*/
   function selfWindow(formName,hiddenName,hiddenValue,tableName,errorMessage) {
    var temptable;  
    temptable = document.all[tableName];
    var i,checkedNum=0;
    if (temptable.rows(0).cells(0).firstChild.checked){
      //alert(errorMessage);
      return;
    }
    for(i=temptable.rows.length-1;i>=1;i--){
	  if(temptable.rows(i).cells(0).firstChild.checked) {
	    checkedNum++;
	  }
    }
    if(checkedNum!=0) {
      //alert(errorMessage);
    } else {
      document.all[formName].target="_self";
      document.all[hiddenName].value="S"+hiddenValue;
      document.all[formName].submit();
    } 
   }
   
   /*--new--????????????????????,??hidden????????????????open window*/
   function selfWindow1(formName,hiddenName,hiddenValue,tableName,errorMessage) {
    var temptable;  
    temptable = document.all[tableName];
    var i,checkedNum=0;
    for(i=temptable.rows.length-1;i>=1;i--){
	  if(temptable.rows(i).cells(0).firstChild.checked) {
	    checkedNum++;
	  }
    }
    if(checkedNum!=1) {
      alert(errorMessage);
    } else {
      document.all[formName].target="_self";
      document.all[hiddenName].value="S"+hiddenValue;
      document.all[formName].submit();
    } 
   }
   
   /*--new--????????????????????,??hidden????????????????open window*/
   function selfWindow2(formName,tableName,errorMessage) {
    var temptable;  
    temptable = document.all[tableName];
    var i,checkedNum=0;
    for(i=temptable.rows.length-1;i>=1;i--){
	  if(temptable.rows(i).cells(0).firstChild.checked) {
	    checkedNum++;
	  }
    }
    if(checkedNum!=1) {
      alert(errorMessage);
      return false;
    } else {
      document.all[formName].target="_self";
      document.all[formName].submit();
    } 
   }
   /*--new--????????????????????,??hidden????????????????open window,????*/
   function selfWindow3(formName,tableName,errorMessage) {
    var temptable;  
    temptable = document.all[tableName];
    var i,checkedNum=0;
    for(i=temptable.rows.length-1;i>=1;i--){
	  if(temptable.rows(i).cells(0).firstChild.checked) {
	    checkedNum++;
	  }
    }
    if(checkedNum<1) {
      alert(errorMessage);
      return false;
    } else {
      document.all[formName].target="_self";
      document.all[formName].submit();
    } 
   }
   
   /*--new--????????????????????,??hidden????????????????open window*/
   function newWindow(openPageName,formName,hiddenName,hiddenValue,tableName,widthValue,heightValue,topValue,leftValue,errorMessage) {
    var openWindowPara = "width="+widthValue+",height="+heightValue+",top="+topValue+",left="+leftValue+",resizable=yes,,scrollbars=yes,location=no,status=yes";
    var win = window.open("",openPageName,openWindowPara);
    win.focus();
    document.all[formName].target=openPageName;
    document.all[hiddenName].value="S"+hiddenValue;
    document.all[formName].submit(); 
  
   }
   
   /*--new--????????????????????,??hidden????????????????open window*/
   function newWindow1(openPageName,formName,hiddenName,hiddenValue,tableName,widthValue,heightValue,topValue,leftValue,errorMessage) {
    var temptable;  
    temptable = document.all[tableName];
    var i,checkedNum=0;
    for(i=temptable.rows.length-1;i>=1;i--){
	  if(temptable.rows(i).cells(0).firstChild.checked) {
	    checkedNum++;
	  }
    }
    if(checkedNum!=1) {
      alert(errorMessage);
      //document.location.reload();
      return false;
    } else {
      var openWindowPara = "width="+widthValue+",height="+heightValue+",top="+topValue+",left="+leftValue+",resizable=1,edge:Raised";
      var win = window.open("",openPageName,openWindowPara);
      win.focus();
      document.all[formName].target=openPageName;
      document.all[hiddenName].value="S"+hiddenValue;
      document.all[formName].submit();
    } 
   }
   
   /**/
   function popupWindowPrepare(openPageName,formName,hiddenName,hiddenValue,tableName,widthValue,heightValue,topValue,leftValue,errorMessage) {
    var temptable;  
    temptable = document.all[tableName];
    var i,checkedNum=0;
    for(i=temptable.rows.length-1;i>=1;i--){
	  if(temptable.rows(i).cells(0).firstChild.checked) {
	    checkedNum++;
	  }
    }
    if(checkedNum!=1) {
      alert(errorMessage);
      return false;
    } 
   }
   
   /*--new--??????????????????,??hidden????????????????open window*/
   function newWindow2(openPageName,formName,hiddenName,hiddenValue,tableName,widthValue,heightValue,topValue,leftValue,errorMessage) {
      var openWindowPara = "width="+widthValue+",height="+heightValue+",top="+topValue+",left="+leftValue+",resizable=1,scrollbars=1,edge:Raised";
      var win = window.open("",openPageName,openWindowPara);
      win.focus();
      document.all[formName].target=openPageName;
      document.all[hiddenName].value="S"+hiddenValue;
      document.all[formName].submit();
   }
   
   /*--new--??????????????????,??hidden????????????????open window*/
   function newWindow3(openPageName,formName,hiddenName,hiddenValue,tableName,widthValue,heightValue,topValue,leftValue,errorMessage) {
    var temptable;  
    temptable = document.all[tableName];
    var i,checkedNum=0;
    for(i=temptable.rows.length-1;i>=1;i--){
	  if(temptable.rows(i).cells(0).firstChild.checked) {
	    checkedNum++;
	  }
    }
    if(checkedNum!=1) {
      alert(errorMessage);
      //document.location.reload();
      return false;
    } else {
      var openWindowPara = "width="+widthValue+",height="+heightValue+",top="+topValue+",left="+leftValue+",resizable=1,scrollbars=1,edge:Raised";
      var win = window.open("",openPageName,openWindowPara);
      win.focus();
      document.all[formName].target=openPageName;
      document.all[hiddenName].value="S"+hiddenValue;
      document.all[formName].submit();
    } 
   }
   
   /*--new--????????????????hidden????????open window*/
   function newWindow4(openPageName,formName,widthValue,heightValue,topValue,leftValue) {
     var openWindowPara = "width="+widthValue+",height="+heightValue+",top="+topValue+",left="+leftValue+",resizable=1,scrollbars=1,edge:Raised";
     var win = window.open("",openPageName,openWindowPara);
     win.focus();
     document.all[formName].target=openPageName;
     document.all[formName].submit();      
   }
   
   /*--new--??????????????hidden????????open window*/
   function newWindow5(openPageName,formName,hiddenName,hiddenValue,widthValue,heightValue,topValue,leftValue) {
     var openWindowPara = "width="+widthValue+",height="+heightValue+",top="+topValue+",left="+leftValue+",resizable=1,scrollbars=1";
     var win = window.open("",openPageName,openWindowPara);
     win.focus();
     document.all[formName].target=openPageName;
     document.all[hiddenName].value="S"+hiddenValue;
     document.all[formName].submit();      
   }
   
   /*--new--????????????????????,??hidden????????????????open window*/
   function newWindow6(openPageName,formName,hiddenName,hiddenValue,tableName,widthValue,heightValue,topValue,leftValue,errorMessage) {
    var temptable;  
    temptable = document.all[tableName];
    var i,checkedNum=0;
    for(i=temptable.rows.length-1;i>=1;i--){
	  if(temptable.rows(i).cells(0).firstChild.checked) {
	    checkedNum++;
	  }
    }
    if(checkedNum==0) {
      alert(errorMessage);
      return false;
    } else {
      var openWindowPara = "width="+widthValue+",height="+heightValue+",top="+topValue+",left="+leftValue+",resizable=1,edge:Raised";
      var win = window.open("",openPageName,openWindowPara);
      win.focus();
      document.all[formName].target=openPageName;
      document.all[hiddenName].value="S"+hiddenValue;
      document.all[formName].submit();
    } 
   }
   
   /*--new--????????????????????,????hidden????????????????open window*/
   function newWindow7(openPageName,formName,tableName,widthValue,heightValue,topValue,leftValue,errorMessage) {
    var temptable;  
    temptable = document.all[tableName];
    var i,checkedNum=0;
    for(i=temptable.rows.length-1;i>=1;i--){
	  if(temptable.rows(i).cells(0).firstChild.checked) {
	    checkedNum++;
	  }
    }
    if(checkedNum!=1) {
      alert(errorMessage);
      return false;
    } else {
      var openWindowPara = "width="+widthValue+",height="+heightValue+",top="+topValue+",left="+leftValue+",resizable=1,edge:Raised";
      var win = window.open("",openPageName,openWindowPara);
      win.focus();
      document.all[formName].target=openPageName;
      document.all[formName].submit();
    } 
   }
   
   /*--new--??????????????hidden????????open window*/
   function newWindow8(openPageName,formName,hiddenName,hiddenValue,widthValue,heightValue,topValue,leftValue) {
     var openWindowPara = "width="+widthValue+",height="+heightValue+",top="+topValue+",left="+leftValue+",resizable=0,scrollbars=1,fullscreen=3,edge:Raised";
     var win = window.open("",openPageName,openWindowPara);
     win.focus();
     document.all[formName].target=openPageName;
      document.all[hiddenName].value="S"+hiddenValue;
     document.all[formName].submit();      
   }
   
   /*--new--????????????????hidden????????open window*/
   function openWindow2(openPageName,formName,widthValue,heightValue,topValue,leftValue) {
     var openWindowPara = "width="+widthValue+",height="+heightValue+",top="+topValue+",left="+leftValue+",resizable=1,scrollbars=1,edge:Raised";
     var win = window.open("",openPageName,openWindowPara);
     win.focus();
     document.all[formName].target=openPageName;
     document.all[formName].submit();      
   } 
   
   /*--new--??????????????????????,??hidden????????open window*/
   function openWindow3(openPageName,formName,hiddenName,hiddenValue,widthValue,heightValue,topValue,leftValue) {
     var openWindowPara = "width="+widthValue+",height="+heightValue+",top="+topValue+",left="+leftValue+",resizable=0";
     window.open("",openPageName,openWindowPara);
     document.all[formName].target=openPageName;
     document.all[hiddenName].value="S"+hiddenValue;
     document.all[formName].submit(); 
   }
   
   /*--new--??????????????hidden??????????????????*/
   function selfWindowClick(formName,hiddenName,hiddenValue) {  
       document.all[formName].target="_self";
   	   document.all[hiddenName].value="S"+hiddenValue;
   	   document.all[formName].submit();
   } 
   
   /*--new--??????????????????,??????Message????*/
   function confirmClick(formName,hiddenName,hiddenValue,tableName,confirmMessage1,confirmMessage2) {
    var temptable;  
    temptable = document.all[tableName];
    var i,checkedNum=0;
    if (temptable.rows.length == 1){
      alert(confirmMessage1);
      return false;
    }
    for(i=temptable.rows.length-1;i>=1;i--){
	  if(temptable.rows(i).cells(0).firstChild.checked) {
	    checkedNum++;
	  }
    }
    if(checkedNum==0) {
      alert(confirmMessage1);
      //document.location.reload();
      return false;
    } else if (confirm(confirmMessage2)) {
         var win = window.open("","Message","top=300,left=400,width=200,height=100,resizable=1,edge:Raised");
         win.focus();
         document.all[formName].target="Message";
   	     document.all[hiddenName].value="S"+hiddenValue;
   	     document.all[formName].submit();
   	}
   } 
   
   /*--new--??????????????????,??????Message????*/
   function confirmClickReloadThis(formName,hiddenName,hiddenValue,tableName,confirmMessage1,confirmMessage2) {
    var temptable;  
    temptable = document.all[tableName];
    var i,checkedNum=0;
    if (temptable.rows.length == 1){
      alert(confirmMessage1);
   	  document.location.reload();
   	  return;
    }
    for(i=temptable.rows.length-1;i>=1;i--){
	  if(temptable.rows(i).cells(0).firstChild.checked) {
	    checkedNum++;
	  }
    }
    if(checkedNum==0) {
      alert(confirmMessage1);
      document.location.reload();
      return;
    } else { 
       if (confirm(confirmMessage2)) {
         var win = window.open("","Message","top=300,left=400,width=200,height=100,resizable=1,edge:Raised");
         win.focus();
         document.all[formName].target="Message";
   	     document.all[hiddenName].value="S"+hiddenValue;
   	     document.all[formName].submit();
   	   } else {
   	     document.location.reload();
   	   }
   	}
   } 
   
   /*--new--????????????????????????????????*/
   function submitClickSelf(formName,hiddenName,hiddenValue,tableName,confirmMessage1) {
    var temptable;  
    temptable = document.all[tableName];
    var i,checkedNum=0;
    if (temptable.rows.length == 1){
      alert(confirmMessage1);
      return false;
    }
    for(i=temptable.rows.length-1;i>=1;i--){
	  if(temptable.rows(i).cells(0).firstChild.checked) {
	    checkedNum++;
	  }
    }
    if(checkedNum!=1) {
      alert(confirmMessage1);
      //document.location.reload();
      return false;
    }else{ 

         document.all[formName].target="_self";
   	     document.all[hiddenName].value="S"+hiddenValue;
   	     document.all[formName].submit();
   	}

   } 
   
   /*--self--??????????????????,??????????????*/
   function confirmClickSelf(formName,hiddenName,hiddenValue,tableName,confirmMessage1,confirmMessage2) {
    var temptable;  
    temptable = document.all[tableName];
    var i,checkedNum=0;
    if (temptable.rows.length == 1){
      alert(confirmMessage1);
      //document.location.reload();
      return false;
    }
    for(i=temptable.rows.length-1;i>=1;i--){
	  if(temptable.rows(i).cells(0).firstChild.checked) {
	    checkedNum++;
	  }
    }
    if(checkedNum==0) {
      alert(confirmMessage1);
      //document.location.reload();
      return false;
   } 
    else if(confirm(confirmMessage2))
    {
    	document.all[formName].target="_self";
    	document.all[hiddenName].value="S"+hiddenValue;
    	document.all[formName].submit();
    }
    else
    {
	    //document.location.reload();
	    return false;
    }
   } 
   /*--new--????message????*/
   function openMessageClick(formName,hiddenName,hiddenValue) {
       var win = window.open("app?service=page/Message","Message","top=300,left=400,width=200,height=100,resizable=1,edge:Raised");
       win.focus();
       document.all[formName].target="Message";
   	   document.all[hiddenName].value="S"+hiddenValue;
   	   document.all[formName].submit();
   }
   
   /*--new--??????????????????,??????Message????*/
   function openMessageNotConfirmClick(formName,hiddenName,hiddenValue,tableName,confirmMessage1) {
    var temptable;  
    temptable = document.all[tableName];
    var i,checkedNum=0;
    if (temptable.rows.length == 1){
      alert(confirmMessage1);
      return false;
    }
    for(i=temptable.rows.length-1;i>=1;i--){
	  if(temptable.rows(i).cells(0).firstChild.checked) {
	    checkedNum++;
	  }
    }
    if(checkedNum==0) {
      alert(confirmMessage1);
      return false;
    } else {
         var win = window.open("","Message","top=300,left=400,width=200,height=100,resizable=1,edge:Raised");
         win.focus();
         document.all[formName].target="Message";
   	     document.all[hiddenName].value="S"+hiddenValue;
   	     document.all[formName].submit();
   	}
   } 
   
   
   
   function confirmSelfToSelfClick(formName,tableName,confirmMessage) {
    var temptable;  
    temptable = document.all[tableName];
    var i,checkedNum=0;
    if (temptable.rows.length == 1){
      alert(confirmMessage);
      return false;
    }
    for(i=temptable.rows.length-1;i>=1;i--){
	  if(temptable.rows(i).cells(0).firstChild.checked) {
	    checkedNum++;
	  }
    }
    if(checkedNum!=1) {
     alert(confirmMessage);
     return false;
    } 
    else 
    {
    	document.all[formName].submit();
    }
   }

   
   /*??????????*/
   function fullWindow(e){
            var mode=0
	        var old=new Array();
			if(mode==0){
				if(typeof document.all!='undefined'){				    
                    if(top.document.body.offsetWidth==screen.availWidth){
                      top.moveBy(e.clientX-e.screenX,e.clientY-e.screenY);
					  //top.resizeBy(screen.availWidth-1016,
					  //screen.availHeight-620);
                      e.returnValue=false;
                      return false;
                    } else {
					  top.moveBy(e.clientX-e.screenX,e.clientY-e.screenY);
					  top.resizeBy(screen.availWidth-top.document.body.offsetWidth,
						screen.availHeight-top.document.body.offsetHeight);
				    }
				}else{
				    
					window.top.moveTo(0,0);
					window.top.resizeTo(screen.availWidth,screen.availHeight);
					old[0]=window.toolbar.visible;
					old[1]=window.statusbar.visible;
					old[2]=window.menubar.visible;
					window.toolbar.visible=false;
					window.statusbar.visible=false;
					window.menubar.visible=false;
				}
				mode=1;
			}else{
				if(typeof document.all!='undefined'){
				   
					top.moveTo(0,0);
					top.resizeTo(screen.availWidth,screen.availHeight);
				}else{
				    
					window.toolbar.visible=old[0];
					window.statusbar.visible=old[1];
					window.menubar.visible=old[2];
				}
				mode=0;
			}
			return true;
	}
	
	/*??????????*/
	/*????????*/
	function emptyValidate(inputComponent,errorMessage) {
	  var t = document.all[inputComponent].value;
      t = t.replace(/(^\s*)|(\s*$)/g, "");
	  if(t==""){
	    window.alert(errorMessage);
    	document.all[inputComponent].focus();
	    return false;
	  }
	  document.all[inputComponent].value = t;
	}
	
	/*????????*/
	function killSpace(inputComponent) {
	  var t = document.all[inputComponent].value;
	  t = t.replace(/(^\s*)|(\s*$)/g, "");
	  document.all[inputComponent].value = t;
	}
	
	/*????????*/
	function emptyInnerTextValidate(inputComponent,focusComponent) {
	  
	  var flag = 0;
	  if(document.getElementById(inputComponent) == null){
		flag = 1;
	  } else if(document.getElementById(inputComponent).innerText=="") {
	    flag = 2;
	  }
	  if(flag != 0) {
	    window.alert(document.getElementById(focusComponent).innerText+"??????????");
    	//document.getElementById(focusComponent).select();	
	    return false;	  
	  }
	}
	
	/*????????*/
	function emptyValidateForDisable(inputComponent,errorMessage) {
	  if(document.all[inputComponent].value==""){
	    window.alert(errorMessage);    	
	    return false;
	  }
	}	
		
	/*????????????????????*/
	function selectionValidate(inputComponent,errorMessage) {
	  if(document.all[inputComponent].value=="0:"){
	    alert(errorMessage);
    	document.all[inputComponent].focus();
	    return false;
	  }
	} 
	
	/*????id??????????*/
	function isMatchSelectionById(inputComponent,trueId) 
	{
	  var s = document.all[inputComponent].value;
	  var len = s.length;
	  if(len==0) 
	  {
	    return false;
	  }
	  var regv = /^\d+:\d+$/;
	  if(!regv.test(s))
	  { 
	    return false;
	  }
	  else
	  { 
	    var trimVar = /\d+:/;	
	    s = s.replace(trimVar,"");
	   // alert(s);
	   if(trueId==s) 
	   {  
	     
	      return true;
	    } else
	    { 
	      
	      return false;	    
	    }
	  }
    }
    
    /*?????????? ??????????????????????????????????????,??????????????
     *????inputComponent:????id;listSeparator:???????? 
    **/
    function getSubString(s,listSeparator) {
	  //var s = document.all[inputComponent].value;
	 // var len = s.length;
	  //var sub = s;
	  //if(len == 0) 
	  //{
	  // return sub;
	  //}
	  var sub="";
      var strIndex = s.indexOf(listSeparator);
      if(strIndex!=-1){
        sub = s.substring(strIndex+1);
      } 
      return sub;
    }
   
    /*?????????? ??????????????????????????????????????,??????????????
     *????inputComponent:????id;listSeparator:???????? 
    **/ 
    function getSubStringBefore(inputComponent,listSeparator) {
	  var s = document.all[inputComponent].value;
	  var len = s.length;
	  var sub = s;
	  if(len == 0) 
	  {
	    return sub;
	  }
      var strIndex = s.indexOf(listSeparator);
      if(strIndex!=-1){
        sub = s.substring(0,strIndex);
      } 
      return sub;
    }
    
    
    function protoSelectionValue(selectComponent,hiddenComponent) {
      var sel = document.all[selectComponent];
      var v = document.all[hiddenComponent].value.substring(1);
      var strIndex,sub;
      sel.selectedIndex=0;
      for(i=1;i<sel.length;i++) {
        strIndex = sel.options[i].value.indexOf(":");
        if(strIndex!=-1){
          sub = sel.options[i].value.substring(strIndex+1);
        }
        if(sub == v) {
          sel.selectedIndex=i;          
        }
      }       
    }
	
	
	/*????????????*/
	function isEmpty(inputComponent) {
	  var s = document.all[inputComponent].value;
	  var len = s.length;
	  if(len==0) {
	    return true;
	  } else {
	    return false;
	  }
	}   
	
	/*??????????,??KeyPress??????????????*/
    function isMoney(errorMessage){
      var s = window.event.keyCode;
      if (!(((s>=48) && (s<= 57)) ||(s==44) || (s==46) || (s==13) || (s==27))){
        window.event.keyCode = 0 ;
        alert(errorMessage);
      }
    }    
    
    /*??????????????,??form??????????????????*/ 
    function moneyFormatValidate(inputComponent,errorMessage){
      var s = document.all[inputComponent].value;
      var len = s.length;
      var i,j=0;
      if(len==0) {
        document.all[inputComponent].value = "";
        return true;
      }
       var regv = /^[^,\u4E00-\u9FA5](\d)*(,\d{3})*(\.\d{1,4})?$/;
       if(!regv.test(s)) {
         alert(errorMessage);           
         document.all[inputComponent].focus();
         document.all[inputComponent].select();
         return false;
	   } else {
            return true;        
       }
    } 

	
	/*????????????,??KeyPress??????????????*/
    function isFloatNumber(errorMessage){
      var s = window.event.keyCode;
      if (!(((s>=48) && (s<= 57)) ||(s==46) || (s==13) || (s==27))){
        window.event.keyCode = 0 ;
        alert(errorMessage);
      }
    }  
    
    /*????????????????,??form??????????????????*/ 
    function floatFormatValidate(inputComponent,errorMessage){
      var s = document.all[inputComponent].value;
      var len = s.length;
      var i,j=0;
      if(len==0) {
        document.all[inputComponent].value = "";
        return true;
      }
       var regv = /^((\d+.\d+)|\d+)$/;
       if(!regv.test(s)) {
         alert(errorMessage);           
         document.all[inputComponent].focus();
         document.all[inputComponent].select();
         return false;
	   } else {
            return true;        
       }
    } 
    
    function floatFormatValidate(inputComponent){
      var s = document.all[inputComponent].value;
      var len = s.length;
      var i,j=0;
      if(len==0) {
        document.all[inputComponent].value = "";
        return true;
      }
       var regv = /^((\d+.\d+)|\d+)$/;
       if(!regv.test(s)) {
         return false;
	   } else {
            return true;        
       }
    } 
 
	/*??????????,??KeyPress????????*/
    function isIntegerNumber(errorMessage){
      var s = window.event.keyCode;
      if (!(((s>=48) && (s<= 57)) ||(s==40)||(s==41)|| (s==13) || (s==27) || (s==42) || (s==45)||(s==95))){
        window.event.keyCode = 0 ;
        alert(errorMessage);
      }
    } 
    
    /*??????????????,??form??????????????????*/ 
    function integerFormatValidate(inputComponent,errorMessage){
      var s = document.all[inputComponent].value;
      var len = s.length;
      var i,j=0;
      if(len==0) {
        document.all[inputComponent].value = "";
        return true;
      }
       var regv = /^(\d+)$/;
       if(!regv.test(s)) {
         alert(errorMessage);           
         document.all[inputComponent].focus();
         document.all[inputComponent].select();
         return false;
	   } else {
            return true;        
       }
    }
    
	/*??????????????????,??KeyPress??????????????*/
    function isFixTelNumber(errorMessage){
      var s = window.event.keyCode;
      if (!(((s>=48) && (s<= 57)) || (s==40)||(s==41)|| (s==13) || (s==27) || (s==42) || (s==45)||(s==95))){
        window.event.keyCode = 0 ;
        alert(errorMessage);
      }
    }
    
	/*??????????????????,??form??????????????????*/
    function fixTelValidateNumber(inputComponent,errorMessage){
      var s = document.all[inputComponent].value;
      var len = s.length;
      if(len==0) {
        return true;
      }
	  //var regv=/^(((\d+){1,25})|((\d+-\d+){1,25})|((\(\d+\)-\d+-\d+){1,25}))$/;
	  var regv = /^((\d|\*|-|\(|\))+){1,30}$/
	  if(!regv.test(s)){
	    alert(errorMessage);
	    document.all[inputComponent].focus();
	    document.all[inputComponent].select();
		return false;
	  }      
    }
    
	/*??????????????,??KeyPress??????????????*/
    function isMobileNumber(errorMessage){
      var s = window.event.keyCode;
      if (!(((s>=48) && (s<= 57)) || (s==13) || (s==27))){
        window.event.keyCode = 0 ;
        alert(errorMessage);
      }
    }
    
	/*??????????????,??form??????????????????*/
    function mobileValidateNumber(inputComponent,errorMessage){
      var s = document.all[inputComponent].value;
      var len = s.length;
      if(len==0) {
        return true;
      }
	  var regv = /^(013|913|13)(\d{9})$/
	  if(!regv.test(s)){
	    alert(errorMessage);
	    document.all[inputComponent].focus();
	    document.all[inputComponent].select();
		return false;
	  }      
    }
    
  /*????????????????????????*/
  function isLetterValidate(errorMessage) {
      var s = window.event.keyCode;
      if (!(((s>=48) && (s<= 57)) || ((s>=65) && (s<= 90)) || ((s>=97) && (s<= 122)) || (s==40)||(s==41)|| (s==13) || (s==27) || (s==45))){
        window.event.keyCode = 0 ;
        alert(errorMessage);
      }  
  }
    
  /*????????????????????????*/
  function letterNumberValidate(inputComponent,errorMessage) {
    var s = document.all[inputComponent].value;
    s=trim(s);
    var len = s.length;
	if(len == 0) return true;
	else {
            var regv=/^([a-z]|[A-Z]|\d|-|\_|\*|\(|\))+$/ ;
	        if(!regv.test(s)) {
	         alert(errorMessage);
			 document.all[inputComponent].focus();
			 document.all[inputComponent].select();
	         return false;
	        }
	      }
  }
    
    /*????????????????*/
    function stringLengthValidate(inputComponent,min,minErrorMessage,max,maxErrorMessage) {
      var s = document.all[inputComponent].value;
      var len = s.length;
      if(len==0) {
        return true;
      }
      var maxLength = parseInt(max);
      var minLength = parseInt(min);
      if(minLength>maxLength||minLength<0||maxLength<0) {
            return false;
      }
      if(len<minLength) {
            alert(minErrorMessage);           
            document.all[inputComponent].focus();
            document.all[inputComponent].select();
            return false;       
      } else if(len>maxLength) {
            alert(maxErrorMessage);
            document.all[inputComponent].focus();
            document.all[inputComponent].select();
            return false;       
      }
    }
    
    /*????????????????*/
    function integerScopeValidate(inputComponent,min,minErrorMessage,max,maxErrorMessage) {
      var tmp = document.all[inputComponent].value;
      var len = tmp.length;
      if(len==0) {
        return true;
      }
      var s = parseInt(tmp);
      var minNum = parseInt(min);
      var maxNum = parseInt(max);
      if(minNum>maxNum||minNum<0||maxNum<0) {
            return false;
      }
      if(s<minNum) {
            alert(minErrorMessage);           
            document.all[inputComponent].focus();
            document.all[inputComponent].select();
            return false;       
      } else if(s>maxNum) {
            alert(maxErrorMessage);           
            document.all[inputComponent].focus();
            document.all[inputComponent].select();
            return false;       
      }
    }    

    /*??????????????????*/
    function floatScopeValidate(inputComponent,min,minErrorMessage,max,maxErrorMessage) {
    
      var tmp = document.all[inputComponent].value;
      var len = tmp.length;
      
      if(len==0) {
        return true;
      }
      var re = /,/g;
      tmp = tmp.replace(re,"");
      var len = tmp.length;
      var s = parseFloat(tmp);
      var minNum = parseFloat(min);
      var maxNum = parseFloat(max);

      if(minNum>maxNum||minNum<0||maxNum<0) {
            return false;
      }

      if(s<minNum) {
            alert(minErrorMessage);           
            document.all[inputComponent].focus();
            document.all[inputComponent].select();
            return false;       
      } else if(s>maxNum) {
            alert(maxErrorMessage);
            document.all[inputComponent].focus();
            document.all[inputComponent].select();
            return false;       
      }
    }  
    
    /*??????????????????*/
    function floatScopeValidate1(inputComponent,min,max) {
      var tmp = document.all[inputComponent].value;
      var len = tmp.length;
      if(len==0) {
        return true;
      }
      var re = /,/g;
      tmp = tmp.replace(re,"");
      var len = tmp.length;
      var s = parseFloat(tmp);
      var minNum = parseFloat(min);
      var maxNum = parseFloat(max);
      if(minNum>maxNum||minNum<0||maxNum<0) {
            return false;
      }
      if(s<minNum) {
            return false;       
      } else if(s>maxNum) {
            return false;       
      }
    }
    
    /*??????????????????????????*/
    function floatScopeExtValidate(inputComponent,min,minErrorMessage) {
      var tmp = document.all[inputComponent].value;
      var len = tmp.length;
      if(len==0) {
        return true;
      }
      var s = parseFloat(tmp);
      var minNum = parseFloat(min);
      if(minNum<0) {
            return false;
      }
      if(s<minNum) {
            alert(minErrorMessage);           
            document.all[inputComponent].focus();
            document.all[inputComponent].select();
            return false;       
      }
    } 

    
    /*????????????*/
    function emailFormatValidate(inputComponent,errorMessage) {
      var s = document.all[inputComponent].value;
      var len = s.length;
      if(len==0) {
        return true;
      }
	  /*var regv=/^[^@ ]+@([\w\-]+\.)+[\w\-]+$/;*/
	  var regv = /^[^@](\S)*@((\w+\.)|(\w+\-+\w+\.))+([a-z]|[A-Z])+$/;
	  if(!regv.test(s)){
	    alert(errorMessage);
	    document.all[inputComponent].focus();
	    document.all[inputComponent].select();
		return false;
	  }
	  return true;
    } 
    
    /*????????*/
    function timeFormatValidate(inputComponent,errorMessage) {
      var s = document.all[inputComponent].value;
      
      var len = s.length;
     
      if(len==0) {
        return true;
      }
	  var regv=/^((([0-1]\d)|(2[0-3])):[0-5]\d)$/;
	  if(!regv.test(s)){
	    alert(errorMessage);
	    document.all[inputComponent].focus();
	    document.all[inputComponent].select();
	  	return false;
	  }
	  return true;
    } 
      
    
/*????????*/  
function isDateString(sDate)
{	var iaMonthDays = [31,28,31,30,31,30,31,31,30,31,30,31]
	var iaDate = new Array(3)
	var year, month, day

	if (arguments.length != 1) return false
	iaDate = sDate.toString().split("-")
	if (iaDate.length != 3) return false
	if (iaDate[1].length > 2 || iaDate[2].length > 2) return false
	if (isNaN(iaDate[0])||isNaN(iaDate[1])||isNaN(iaDate[2])) return false

	year = parseFloat(iaDate[0])
	month = parseFloat(iaDate[1])
	day=parseFloat(iaDate[2])

	if (year < 1900 || year > 2100) return false
	if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) iaMonthDays[1]=29;
	if (month < 1 || month > 12) return false
	if (day < 1 || day > iaMonthDays[month - 1]) return false
	return true
}

 
function stringToDate(sDate, bIgnore)
{	var bValidDate, year, month, day
	var iaDate = new Array(3)
	
	if (bIgnore) bValidDate = true
	else bValidDate = isDateString(sDate)
	
	if (bValidDate)
	{  iaDate = sDate.toString().split("-")
		year = parseFloat(iaDate[0])
		month = parseFloat(iaDate[1]) - 1
		day=parseFloat(iaDate[2])
		return (new Date(year,month,day))
	}
	else return (new Date(1900,1,1))
}

 
 function compareDateValidate(inputComponent1,inputComponent2,errorMessage){
   var dt1 = document.all[inputComponent1].value;
   var dt2 = document.all[inputComponent2].value;
   var len1 = dt1.length;
   var len2 = dt2.length;
   if(len1==0||len2==0) {
     return true;
   }
   if(stringToDate(dt1,true)>stringToDate(dt2,true)) {
	    alert(errorMessage);
	    document.all[inputComponent2].focus();
	    
	    document.all[inputComponent2].select();
		return false;   
   }
 }

/*????????????*/
function compareDateExtValidate(inputComponent1,inputComponent2,errorMessage) {
   var dt1 = document.all[inputComponent1].value;
   var dt2 = document.all[inputComponent2].value;
   var len1 = dt1.length;
   var len2 = dt2.length;
   if(len1==0||len2==0) {
     return true;
   }
   if(stringToDate(dt1,true)>=stringToDate(dt2,true)) {
	    alert(errorMessage);
	    document.all[inputComponent2].focus();
	    document.all[inputComponent2].select();
		return false;   
   }
}      


/*????????????*/
function dateFormatValidate(inputComponent,errorMessage) {
  var dt = document.all[inputComponent].value;
  var len = dt.length;
  if(len==0) {
    return true;
  }
  var regv=/^\d\d\d\d-\d\d-\d\d$/;
  if(!regv.test(dt)){
    alert(errorMessage);
    document.all[inputComponent].focus();
    return false;
  }
  if(!isDateString(dt)) {
    alert(errorMessage);
    document.all[inputComponent].focus();
    document.all[inputComponent].select();
    return false;   
  }
}

/*????????????*/
function monthFormatValidate(inputComponent,errorMessage) {
  var dt = document.all[inputComponent].value;
  var len = dt.length;
  if(len==0) {
    return true;
  }
  var regv=/^(\d\d\d\d-0[1-9])|(\d\d\d\d-1[0-2])$/;
  if(!regv.test(dt)){
    alert(errorMessage);
    document.all[inputComponent].focus();
    document.all[inputComponent].select();
    return false;
  }

}


String.prototype.len=function(){ 
return this.replace(/[^\x00-\xff]/g,"**").length; 
} 


function setMaxLength(object,length) 
{ 
var result = true; 
var controlid = document.selection.createRange().parentElement().id; 
var controlValue = document.selection.createRange().text; 

if (controlid == object.id && controlValue != "") 
{ 
result = true; 
} 
else if (object.value.len() >= length) 
{ 
result = false; 
} 
if (window.event) 
{ 
window.event.returnValue = result; 
return result; 
} 
} 


function limitPaste(object,length) 
{ 
var tempLength = 0; 
if(document.selection) 
{ 
if(document.selection.createRange().parentElement().id == object.id) 
{ 
tempLength = document.selection.createRange().text.len(); 
} 
} 
var tempValue = window.clipboardData.getData("Text"); 
tempLength = object.value.len() + tempValue.len() - tempLength; 
if (tempLength > length) 
{ 
tempLength -= length; 
var tt=""; 
for(var i=0;i<tempValue.len()-tempLength;i++) 
{ 
if(tt.len()<(tempValue.len()-tempLength)) 
tt=tempValue.substr(0,i+1); 
else 
break; 
} 
tempValue=tt; 
window.clipboardData.setData("Text", tempValue); 
} 

window.event.returnValue = true; 
} 

function txtBlur(object,length,message1,message2){
  var tempStr = "";
  if(object.value.len() > length){
    //if(confirm(message1+length+message2)) {
    //  for(var i=0;i<object.value.len();i++) { 
    //    if(tempStr.len() >= length){
    //      break;
    //    }else{
    //      tempStr = object.value.substr(0,i);
    //    }
    //  }
    //  if(tempStr.len() > length){
        
        //object.value = tempStr.substr(0,tempStr.length-1) ;
    //  }else{
    //    object.value =  tempStr ;    
    //  }
    //  object.focus();
    //  var e = event.srcElement;
    //  var r =e.createTextRange();
    //  r.moveStart('character',e.value.length);
    //  r.collapse(true);
    //  r.select();
            
    //} else {
    //  object.value = "";
    //  object.focus();
    //}
    alert(message1+length);
    object.focus();
  } else {
  
  }
}



/**
row line color
*/
/**
 * This array is used to remember mark status of rows in browse mode
 */
var marked_row = new Array;
function setPointer(theRow, theAction, thePointerColor, theMarkColor)
{
    var theRowNum = "";
	var theDefaultColor = "";
    if (theRow.rowIndex % 2 == 0){
      theRowNum = "4505447c-c6c6-21aa-6be0-42af184c1b16";
      theDefaultColor = "#fdfdfd";
    } else {   
      theRowNum = "e16c15c2-7113-80c4-b249-42af18ff28ce";
      theDefaultColor = "#f1f1f1";
    }
	

    var theCells = null;

    // 1. Pointer and mark feature are disabled or the browser can't get the
    //    row -> exits
    if ((thePointerColor == '' && theMarkColor == '')
        || typeof(theRow.style) == 'undefined') {
        return false;
    }

    // 2. Gets the current row and exits if the browser can't get it
    if (typeof(document.getElementsByTagName) != 'undefined') {
        theCells = theRow.getElementsByTagName('td');
    }
    else if (typeof(theRow.cells) != 'undefined') {
        theCells = theRow.cells;
    }
    else {
        return false;
    }

    // 3. Gets the current color...
    var rowCellsCnt  = theCells.length;
    var domDetect    = null;
    var currentColor = null;
    var newColor     = null;
    // 3.1 ... with DOM compatible browsers except Opera that does not return
    //         valid values with "getAttribute"
    if (typeof(window.opera) == 'undefined'
        && typeof(theCells[0].getAttribute) != 'undefined') {
        currentColor = theCells[0].getAttribute('bgcolor');
        domDetect    = true;
    }
    // 3.2 ... with other browsers
    else {
        currentColor = theCells[0].style.backgroundColor;
        domDetect    = false;
    } // end 3

    // 4. Defines the new color
    // 4.1 Current color is the default one
    if (currentColor == ''
        || currentColor.toLowerCase() == theDefaultColor.toLowerCase()) {
        if (theAction == 'over' && thePointerColor != '') {
            newColor              = thePointerColor;
        }
        else if (theAction == 'click' && theMarkColor != '') {
            newColor              = theMarkColor;
            marked_row[theRowNum] = true;
        }
    }
    // 4.1.2 Current color is the pointer one
    else if (currentColor.toLowerCase() == thePointerColor.toLowerCase()
             && (typeof(marked_row[theRowNum]) == 'undefined' || !marked_row[theRowNum])) {
        if (theAction == 'out') {
            newColor              = theDefaultColor;
        }
        else if (theAction == 'click' && theMarkColor != '') {
            newColor              = theMarkColor;
            marked_row[theRowNum] = true;
        }
    }
    // 4.1.3 Current color is the marker one
    else if (currentColor.toLowerCase() == theMarkColor.toLowerCase()) {
        if (theAction == 'click') {
            newColor              = (thePointerColor != '')
                                  ? thePointerColor
                                  : theDefaultColor;
            marked_row[theRowNum] = (typeof(marked_row[theRowNum]) == 'undefined' || !marked_row[theRowNum])
                                  ? true
                                  : null;
        }
    } // end 4

    // 5. Sets the new color...
    if (newColor) {
        var c = null;
        // 5.1 ... with DOM compatible browsers except Opera
        if (domDetect) {
            for (c = 0; c < rowCellsCnt; c++) {
                theCells[c].setAttribute('bgcolor', newColor, 0);
            } // end for
        }
        // 5.2 ... with other browsers
        else {
            for (c = 0; c < rowCellsCnt; c++) {
                theCells[c].style.backgroundColor = newColor;
            }
        }
    } // end 5

    return true;
} // end

function moveLayer(layerName,tableName) {
    var layerVar = document.getElementById(layerName);
    var tableVar = document.getElementById(tableName);
	layerVar.style.posTop = -200; //????onLoad????????????,????????????????????y????????
	layerVar.style.visibility = 'visible'; //????????????
	//????tableName????????????
	var pos = tableVar.offsetTop; 
	while(tableVar=tableVar.offsetParent){ 
	  pos+=tableVar.offsetTop;
	}
	repeatLayer(layerName,tableName,pos); //????????repeatLayer()	
}

function repeatLayer(layerName,tableName,pos) {
    var layerVar = document.getElementById(layerName);
    var tableVar = document.getElementById(tableName);
	var x = 0;//????????????????????x????????
	var y = 0;//????????????????????y????????
	var diff = (document.body.scrollTop + y - layerVar.style.posTop)*.40;
	var y = document.body.scrollTop + y - diff;
    if(document.body.scrollTop >  0) {
	   layerVar.style.display = '';
	   layerVar.style.posTop = y;
	   layerVar.style.posLeft = x;//??????
    } else {
	   layerVar.style.display = 'none';
	}
	var repeatMethod = "repeatLayer('"+layerName+"','"+tableName+"','"+pos+"');";
	setTimeout(repeatMethod, 20);//????20????????????????repeatLayer()
}


function removeClassName (elem, className) {
	elem.className = elem.className.replace(className, "");
}

function addCSSClass (elem, className) {
	removeClassName (elem, className);
	elem.className = elem.className + " " + className;
}


function stripedTable() {
	if (document.getElementById && document.getElementsByTagName) {  
		var allTables = document.getElementsByTagName('table');
		if (!allTables) { return; }

		for (var i = 0; i < allTables.length; i++) {
			if (allTables[i].className.match("listViewRight")) {
				var trs = allTables[i].getElementsByTagName("tr");
				for (var j = 0; j < trs.length; j++) {
					removeClassName(trs[j], 'alternateRow');
					addCSSClass(trs[j], 'normalRow');
				}
				for (var k = 0; k < trs.length; k += 2) {
					removeClassName(trs[k], 'normalRow');
					addCSSClass(trs[k], 'alternateRow');
				}
			}
		}
	}
}


/* onload state is fired, append onclick action to the table's DIV */
/* container. This allows the HTML document to validate correctly. */
/* addIEonScroll added on 2005-01-28                               */
/* Terence Ordona, portal[AT]imaputz[DOT]com                       */
function addIEonScroll() {
	var thisContainer = document.getElementById('tableContainer');
	if (!thisContainer) { return; }

	var onClickAction = 'toggleSelectBoxes();';
	thisContainer.onscroll = new Function(onClickAction);
}


/* Only WinIE will fire this function. All other browsers scroll the TBODY element and not the DIV */
/* This is to hide the SELECT elements from scrolling over the fixed Header. WinIE only.           */
/* toggleSelectBoxes added on 2005-01-28 */
/* Terence Ordona, portal[AT]imaputz[DOT]com         */
function toggleSelectBoxes() {
	var thisContainer = document.getElementById('tableContainer');
	var thisHeader = document.getElementById('fixedHeader');
	if (!thisContainer || !thisHeader) { return; }

	var selectBoxes = thisContainer.getElementsByTagName('select');
	if (!selectBoxes) { return; }

	for (var i = 0; i < selectBoxes.length; i++) {
		if (thisContainer.scrollTop >= eval(selectBoxes[i].parentNode.offsetTop - thisHeader.offsetHeight)) {
			selectBoxes[i].style.visibility = 'hidden';
		} else {
			selectBoxes[i].style.visibility = 'visible';
		}
	}
} 

function initScrollTable(tableName,divName,height,width) {
		var tempDiv = document.getElementById(divName);
        var tempTable = document.getElementById(tableName);
        if(tempTable != null) {
        		tempDiv.className = 'tableContainer';
        		tempDiv.style.width = '100%';
        		if(tempTable.rows.length > 1) {
        			tempDiv.style.height = height;
        			tempDiv.style.border = '1px solid #963';
        		} else {
        			tempDiv.style.height = 40;
        		}
        		tempDiv.style.display = 'inline';
    	}
}
function trim(s) {
  while (s.substring(0,1) == ' ') {
    s = s.substring(1,s.length);
  }
  while (s.substring(s.length-1,s.length) == ' ') {
    s = s.substring(0,s.length-1);
  }
  return s;
}

  /*????checkbox????*/
  function groupAllSelect(allName,selectionName) {
     var tmpFlag;
     if(document.getElementById(allName).checked) {
       tmpFlag = 1;
     } else {
       tmpFlag = 0;
     }
     var group = document.all[selectionName];
     var i;
     /*????*/
     if(tmpFlag == 1) {
       for(i=0;i<group.length;i++) {
           group[i].checked = true;
       }
     } else {
       for(i=0;i<group.length;i++) {
           group[i].checked = false;
       }           
     }
  }
  
  /*??????????????????checkbox????????*/
  function initGroupAllSelect(allName,selectionName) {
     var tmpFlag = 1;
     var group = document.all[selectionName];
     var i;
     for(i=0;i<group.length;i++) {
         if(!group[i].checked) {
           tmpFlag = 0;
           break;
         }
     }
     /*????*/
     if(tmpFlag == 1) {
     	document.getElementById(allName).checked = true;
     } else {
        document.getElementById(allName).checked = false;
     }
  }
  
  
  function tCheckboxCheckedOnlyOne(inputComponent,errorMessage){
     var tNode=document.getElementById(inputComponent);
     var trNode=tNode.getElementsByTagName("tr");
     var checkedNum=0;
     for(i=1 ;i<trNode.length;i++){
	     var iCheckbox=trNode[i].getElementsByTagName("input"); 
	     var len=iCheckbox.length;
	     for(j=0;j<len;j++){
	        if(iCheckbox[j].checked){
	          checkedNum++;
	        }
		 }
	  }
    if(checkedNum != 1){
       alert(errorMessage);  
       return false;
    }
    else{
    	return true;
    }
}
  
  
